package com.fengke.csc.action.product;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.fengke.csc.action.BaseAction;
import com.fengke.dao.model.ProductModel;
import com.fengke.dao.model.TagModel;
import com.fengke.service.CacheService;
import com.fengke.service.DivisionService;
import com.fengke.service.ProductService;
import com.fengke.service.TagService;
import com.fengke.service.vo.AgentProfileVO;
import com.fengke.service.vo.DepartureVO;
import com.fengke.service.vo.DestinationVO;
import com.fengke.service.vo.ProductCategoryVO;
import com.fengke.service.vo.ProductVO;
import com.fengke.service.vo.TagVO;
import com.fengke.util.Constants;
import com.fengke.util.LoggerFactory;
import com.fengke.util.StringUtil;

/**
 * 商品管理相关
 * 
 * @author BlackFalcon
 * 
 * @since 2015-05-23
 *
 */
public class ProductAction extends BaseAction {
	private static final long serialVersionUID = 1L;
	private Logger logger = LoggerFactory.getLogger(ProductAction.class);
	private ProductService productService;
	private DivisionService divisionService;
	private TagService tagService;
	private CacheService cacheService;
	private ProductVO productVO = new ProductVO();
	private List<ProductVO> productVOList;
	private List<ProductCategoryVO> productCategoryVOList; // 商品分类
	private List<DepartureVO> departureVOList; // 出发地
	private List<DestinationVO> destinationVOList; // 目的地
	private ProductCategoryVO productCategoryVO = new ProductCategoryVO();
	private DepartureVO departureVO = new DepartureVO();
	private DestinationVO destinationVO = new DestinationVO();
	private List<TagVO> tagVOList;
	/**
	 * 展示商品列表
	 * 
	 * @return
	 */
	public String showProductList() {
		logger.debug("showProductList");
		if(productVO == null) {
			productVO = new ProductVO();
		}
		if(getPageBean().getCurrentPage() == null || getPageBean().getCurrentPage() <= 0) {
			getPageBean().setCurrentPage(1);
		}
		
		getPageBean().setPageSize(Constants.PageSize.CSC_PAGE_SIZE);
		
		AgentProfileVO sessionAgentProfileVO = (AgentProfileVO) this.getSession(false).getAttribute(Constants.SessionProfileName.CSC_PROFILE_NAME);
		if(sessionAgentProfileVO == null) {
			return Constants.ActionReturnName.NO_LOGIN;
		}
		if(sessionAgentProfileVO.isMerchant()) {
			productVO.getProductModel().setAdminModel(sessionAgentProfileVO.getAdminModel());
		}
		
		// 获取总量
		Integer productVOListSize = null;
		try {
			productVOListSize = productService.researchProductListSize(productVO);
		} catch (Exception e) {
			logger.error("检索商品总量失败！productVO=" + productVO, e);
		}
		
		if(productVOListSize != null && productVOListSize > 0) {
			getPageBean().setResultItemCount(productVOListSize);
			try {
				productVOList = productService.researchProductList(productVO, (getPageBean().getCurrentPage() - 1) * getPageBean().getPageSize(), getPageBean().getPageSize());
			} catch (Exception e) {
				logger.error("检索商品失败！productVO=" + productVO, e);
			}
		} else {
			getPageBean().setResultItemCount(0);
		}
		
		return Constants.ActionReturnName.SUCCESS;
	}
	
	public String productDetail() {
		if(productVO == null || productVO.getProductModel() == null || productVO.getProductModel().getId() == null) {
			this.addPageDangerMessage("关键参数不能为空!");
			return "input";
		}
		
		return Constants.ActionReturnName.SUCCESS;
	}
	
	/**
	 * 删除商品
	 * 
	 * @return
	 */
	public String deleteProduct() {
		// 获取ID列表
		String deletedProductIds = ((String[]) (this.getValue().get("deletedProductIds")))[0];
		if(deletedProductIds == null || StringUtil.isEmpty(deletedProductIds)) {
			this.addPageWarningMessage("待删除条目为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		String [] ids = deletedProductIds.split(" ");
		try {
			productService.deleteProductByIds(Arrays.asList(ids));
		} catch (Exception e) {
			logger.error("删除商品失败！ids=" + ids, e);
			this.addPageDangerMessage("删除商品失败！");
			return Constants.ActionReturnName.SUCCESS;
		}
		this.addPageSuccessMessage("删除成功！");
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("deleteProduct invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	
	public String marketableProduct() {
		Boolean isMarketable = null;
		try {
			isMarketable = Boolean.valueOf(((String[]) (this.getValue().get("isMarketable")))[0]);
		} catch (Exception e) {
			logger.error("marketableProduct 获取isMarketable Exception! this.getValue()=" + this.getValue(), e);
		} catch (Throwable t) {
			logger.error("marketableProduct 获取isMarketable Throwable! this.getValue()=" + this.getValue(), t);
		}
		
		if(isMarketable == null) {
			this.addPageWarningMessage("待更新状态为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		String marketableProductIds = ((String[]) (this.getValue().get("marketableProductIds")))[0];
		if(marketableProductIds == null || StringUtil.isEmpty(marketableProductIds)) {
			this.addPageWarningMessage("待更新条目为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		String [] ids = marketableProductIds.split(" ");
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("isMarketable", isMarketable);
		paramMap.put("list", Arrays.asList(ids));
		try {
			productService.marketableProductByIds(paramMap);
		} catch (Exception e) {
			if(isMarketable) {
				logger.error("商品上架失败！ids=" + ids, e);
				this.addPageDangerMessage("商品上架失败！");
			} else {
				logger.error("商品下架失败！ids=" + ids, e);
				this.addPageDangerMessage("商品下架失败！");
			}
			return Constants.ActionReturnName.SUCCESS;
		}
		if(isMarketable) {
			this.addPageSuccessMessage("上架成功！");
		} else {
			this.addPageSuccessMessage("下架成功！");
		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("marketableProduct invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	
	/**
	 * 点击新建按钮，跳转至新建页面
	 * 
	 * @return
	 */
	public String preCreateProduct() {
		this.setRequestAttr("actionType", "create");
		// 分类列表
		getValidProductCategoryVOList();
		// 出发地列表
		getValidDepartureVOList();
		// 目的地列表
		getValidDestinationVOList();
		// 产品标签列表
		getValidProductTagVOList();
		return Constants.ActionReturnName.SUCCESS;
	}

	public String createProduct() {
		this.setRequestAttr("actionType", "create");
		// 参数校验
		preCreate();
		if(this.hasPageDangerMessage()) {
			// 分类列表
			getValidProductCategoryVOList();
			// 出发地列表
			getValidDepartureVOList();
			// 目的地列表
			getValidDestinationVOList();
			// 产品标签列表
			getValidProductTagVOList();
			return INPUT;
		}
		AgentProfileVO agentProfileVO = (AgentProfileVO) this.getSession(false).getAttribute(Constants.SessionProfileName.CSC_PROFILE_NAME);
		if(agentProfileVO == null || agentProfileVO.getAdminModel() == null) {
			return Constants.ActionReturnName.NO_LOGIN;
		}
		productVO.getProductModel().setAdminModel(agentProfileVO.getAdminModel());
		// 数据入库
		Object id = null;
		try {
			id = productService.createProduct(productVO);
		} catch (Exception e) {
			logger.error("新产品插入数据库失败！productVO=" + productVO, e);
		}
		if(id != null) {
			// 插入成功
			this.addPageSuccessMessage("新建数据成功！");
		} else {
			// 插入失败
			this.addPageDangerMessage("插入失败！");
			// 分类列表
			getValidProductCategoryVOList();
			// 出发地列表
			getValidDepartureVOList();
			// 目的地列表
			getValidDestinationVOList();
			return INPUT;
		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("createProduct invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	
	/**
	 * 获取有效的类型列表
	 */
	private void getValidProductCategoryVOList() {
		// 获取商品类型列表
		ProductCategoryVO productCategoryVO = new ProductCategoryVO();
		
		try {
			productCategoryVOList = productService.researchProductCategoryList(productCategoryVO, 0, Integer.MAX_VALUE);
		} catch (Exception e) {
			logger.error("getValidProductCategoryVOList 获取商品类型列表异常！", e);
		}
	}
	/**
	 * 获取出发地列表
	 */
	private void getValidDepartureVOList() {
		DepartureVO departureVO = new DepartureVO();
		try {
			departureVOList = divisionService.researchDepartureVOList(departureVO, 0, Integer.MAX_VALUE);
		} catch (Exception e) {
			logger.error("getValidProductCategoryVOList 获取出发地列表异常！", e);
		}
	}
	/**
	 * 获取目的地列表
	 */
	private void getValidDestinationVOList() {
		DestinationVO destinationVO = new DestinationVO();
		try {
			destinationVOList = divisionService.researchDestinationVOList(destinationVO, 0, Integer.MAX_VALUE);
		} catch (Exception e) {
			logger.error("getValidDestinationVOList 获取目的地列表异常！", e);
		}
	}
	
	private void getValidProductTagVOList() {
		TagVO tagVO = new TagVO();
		tagVO.setTagModel(new TagModel());
		tagVO.getTagModel().setType(TagModel.Type.product);
		try {
			tagVOList = tagService.researchTagVOList(tagVO);
		} catch (Exception e) {
			logger.error("getValidProductTagVOList Exception!", e);
		}
	}

	/**
	 * 点击更新按钮，跳转至更新页面
	 * 
	 * @return
	 */
	public String preUpdateProduct() {
		this.setRequestAttr("actionType", "update");
		Long productId = productVO.getProductModel().getId();
		productVO = new ProductVO();
		productVO.setProductModel(new ProductModel());
		productVO.getProductModel().setId(productId);
		try {
			productVO = productService.researchProductById(productVO);
		} catch (Exception e) {
			this.logger.error("preUpdateProduct 检索商品异常！productId=" + productId, e);
		}
		// 分类列表
		getValidProductCategoryVOList();
		// 出发地列表
		getValidDepartureVOList();
		// 目的地列表
		getValidDestinationVOList();
		// 产品标签列表
		getValidProductTagVOList();
		return Constants.ActionReturnName.SUCCESS;
	}
	/**
	 * 更新商品信息
	 * 
	 * @return
	 */
	public String updateProduct() {
		this.setRequestAttr("actionType", "update");
		preUpdate();
		if(this.hasPageDangerMessage()) {
			return Constants.ActionReturnName.SUCCESS;
		}
		Long productId = productVO.getProductModel().getId();
		AgentProfileVO agentProfileVO = (AgentProfileVO) this.getSession(false).getAttribute(Constants.SessionProfileName.CSC_PROFILE_NAME);
		if(agentProfileVO == null || agentProfileVO.getAdminModel() == null) {
			return Constants.ActionReturnName.NO_LOGIN;
		}
		if(productVO.getProductModel().getAdminModel() == null) {
			productVO.getProductModel().setAdminModel(agentProfileVO.getAdminModel());
		}
		// 更新数据
		int count = 0;
		try {
			count = productService.updateProductById(productVO);
		} catch (Exception e) {
			logger.error("updateProduct 更新商品信息失败！productId=" + productId, e);
		}
		if(count <= 0) {
			this.addPageDangerMessage("未能更新任何数据！");
		} else {
			this.addPageSuccessMessage("数据更新成功！");
		}
//		try {
//			productVO = productService.researchProductById(productVO);
//		} catch (Exception e) {
//			this.logger.error("updateProduct 检索商品异常！productId=" + productId, e);
//		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("updateProduct invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	/**
	 * 创建前，预校验参数
	 */
	private void preCreate() {
		if(productVO == null || productVO.getProductModel() == null) {
			this.addPageDangerMessage("商品信息为空！");
			return;
		}
		if(StringUtil.isEmpty(productVO.getProductModel().getFullName())) {
			this.addPageDangerMessage("商品主题为空！");
		}
		if(productVO.getProductModel().getProductCategoryModel().getId() == null) {
			this.addPageDangerMessage("商品类型为空！");
		}
	}
	/**
	 * 更新前，预校验参数
	 */
	private void preUpdate() {
		if(productVO == null || productVO.getProductModel() == null) {
			this.addPageDangerMessage("商品信息为空！");
			return;
		}
		if(productVO.getProductModel().getId() == null) {
			this.addPageDangerMessage("待更新商品编码为空！");
			return;
		}
		if(StringUtil.isEmpty(productVO.getProductModel().getFullName())) {
			this.addPageDangerMessage("商品主题为空！");
		}
		if(productVO.getProductModel().getProductCategoryModel().getId() == null) {
			this.addPageDangerMessage("商品类型为空！");
		}
	}

	/**
	 * 商品分类列表
	 * 
	 * @return
	 */
	public String productCategoryManager() {
		logger.debug("showProductCategoryList");
		getValidProductCategoryVOList();
		return Constants.ActionReturnName.SUCCESS;
	}
	public String createProductCategory() {
		if(productCategoryVO == null || productCategoryVO.getProductCategoryModel() == null || StringUtil.isEmpty(productCategoryVO.getProductCategoryModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		productCategoryVO.getProductCategoryModel().setCreateDate(new Date());
		productCategoryVO.getProductCategoryModel().setModifyDate(new Date());
		try {
			productCategoryVO = productService.createProductCategory(productCategoryVO);
		} catch (Exception e) {
			logger.error("createProductCategory Exception! productCategoryVO=" + productCategoryVO, e);
			this.addPageDangerMessage("添加商品分类失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("添加成功！");
		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("createProductCategory invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
		
	}
	public String updateProductCategory() {
		if(productCategoryVO == null || productCategoryVO.getProductCategoryModel() == null || productCategoryVO.getProductCategoryModel().getId() == null || StringUtil.isEmpty(productCategoryVO.getProductCategoryModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		productCategoryVO.getProductCategoryModel().setModifyDate(new Date());
		try {
			productCategoryVO = productService.updateProductCategoryById(productCategoryVO);
		} catch (Exception e) {
			logger.error("updateProductCategory Exception! productCategoryVO=" + productCategoryVO, e);
			this.addPageDangerMessage("更新商品分类失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("更新成功！");
		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("updateProductCategory invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	public String deleteProductCategory() {
		// 获取ID列表
		String deletedIds = ((String[]) (this.getValue().get("deletedProductCategoryIds")))[0];
		if(deletedIds == null || StringUtil.isEmpty(deletedIds)) {
			return Constants.ActionReturnName.SUCCESS;
		}
		String [] ids = deletedIds.split(" ");
		try {
			productService.deleteProductCategoryByIds(Arrays.asList(ids));
		} catch (Exception e) {
			logger.error("删除商品分类失败！ids=" + ids, e);
			this.addPageDangerMessage("删除商品分类失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("删除成功！");
		}
		try {
			cacheService.invalidProductCache();
		} catch (Exception e) {
			logger.error("deleteProductCategory invalidProductCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	/**
	 * 出发地管理
	 * @return
	 */
	public String departurePointManager() {
		logger.debug("departurePointManager");
		getValidDepartureVOList();
		return Constants.ActionReturnName.SUCCESS;
	}
	public String createDeparture() {
		if(departureVO == null || departureVO.getDepartureModel() == null || StringUtil.isEmpty(departureVO.getDepartureModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		departureVO.getDepartureModel().setCreateDate(new Date());
		departureVO.getDepartureModel().setModifyDate(new Date());
		try {
			departureVO = divisionService.createDeparture(departureVO);
		} catch (Exception e) {
			logger.error("createDeparture Exception! departureVO=" + departureVO, e);
			this.addPageDangerMessage("添加出发地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("添加成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("createDeparture invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	public String updateDeparture() {
		if(departureVO == null || departureVO.getDepartureModel() == null || departureVO.getDepartureModel().getId() == null || StringUtil.isEmpty(departureVO.getDepartureModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		departureVO.getDepartureModel().setModifyDate(new Date());
		try {
			departureVO = divisionService.updateDepartureById(departureVO);
		} catch (Exception e) {
			logger.error("updateDepartureById Exception! departureVO=" + departureVO, e);
			this.addPageDangerMessage("更新出发地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("更新成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("updateDeparture invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	public String deleteDeparture() {
		// 获取ID列表
		String deletedIds = ((String[]) (this.getValue().get("deletedDepartureIds")))[0];
		if(deletedIds == null || StringUtil.isEmpty(deletedIds)) {
			return Constants.ActionReturnName.SUCCESS;
		}
		String [] ids = deletedIds.split(" ");
		try {
			divisionService.deleteDepartureByIds(Arrays.asList(ids));
		} catch (Exception e) {
			logger.error("删除出发地失败！ids=" + ids, e);
			this.addPageDangerMessage("删除出发地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("删除成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("deleteDeparture invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	/**
	 * 目的地管理
	 * @return
	 */
	public String destinationPointManager() {
		logger.debug("destinationPointManager");
		getValidDestinationVOList();
		return Constants.ActionReturnName.SUCCESS;
	}
	
	public String createDestination() {
		if(destinationVO == null || destinationVO.getDestinationModel() == null || StringUtil.isEmpty(destinationVO.getDestinationModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		destinationVO.getDestinationModel().setCreateDate(new Date());
		destinationVO.getDestinationModel().setModifyDate(new Date());
		try {
			destinationVO = divisionService.createDestination(destinationVO);
		} catch (Exception e) {
			logger.error("createDestination Exception! destinationVO=" + destinationVO, e);
			this.addPageDangerMessage("添加目的地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("添加成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("createDestination invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
		
	}
	public String updateDestination() {
		if(destinationVO == null || destinationVO.getDestinationModel() == null || destinationVO.getDestinationModel().getId() == null || StringUtil.isEmpty(destinationVO.getDestinationModel().getName())) {
			this.addPageDangerMessage("关键参数不能为空！");
			return Constants.ActionReturnName.SUCCESS;
		}
		destinationVO.getDestinationModel().setModifyDate(new Date());
		try {
			destinationVO = divisionService.updateDestinationById(destinationVO);
		} catch (Exception e) {
			logger.error("updateDestination Exception! destinationVO=" + destinationVO, e);
			this.addPageDangerMessage("更新目的地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("更新成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("updateDestination invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	public String deleteDestination() {
		// 获取ID列表
		String deletedIds = ((String[]) (this.getValue().get("deletedDestinationIds")))[0];
		if(deletedIds == null || StringUtil.isEmpty(deletedIds)) {
			return Constants.ActionReturnName.SUCCESS;
		}
		String [] ids = deletedIds.split(" ");
		try {
			divisionService.deleteDestinationByIds(Arrays.asList(ids));
		} catch (Exception e) {
			logger.error("删除目的地失败！ids=" + ids, e);
			this.addPageDangerMessage("删除目的地失败！");
		}
		if(!this.hasPageDangerMessage()) {
			this.addPageSuccessMessage("删除成功！");
		}
		try {
			cacheService.invalidDivisionCache();
		} catch (Exception e) {
			logger.error("deleteDestination invalidDivisionCache Exception！", e);
		}
		return Constants.ActionReturnName.SUCCESS;
	}
	
	public ProductService getProductService() {
		return productService;
	}
	public void setProductService(ProductService productService) {
		this.productService = productService;
	}
	public ProductVO getProductVO() {
		return productVO;
	}
	public void setProductVO(ProductVO productVO) {
		this.productVO = productVO;
	}
	public List<ProductVO> getProductVOList() {
		return productVOList;
	}
	public void setProductVOList(List<ProductVO> productVOList) {
		this.productVOList = productVOList;
	}
	public List<ProductCategoryVO> getProductCategoryVOList() {
		return productCategoryVOList;
	}
	public void setProductCategoryVOList(List<ProductCategoryVO> productCategoryVOList) {
		this.productCategoryVOList = productCategoryVOList;
	}

	public DivisionService getDivisionService() {
		return divisionService;
	}

	public void setDivisionService(DivisionService divisionService) {
		this.divisionService = divisionService;
	}

	public List<DestinationVO> getDestinationVOList() {
		return destinationVOList;
	}

	public void setDestinationVOList(List<DestinationVO> destinationVOList) {
		this.destinationVOList = destinationVOList;
	}

	public List<DepartureVO> getDepartureVOList() {
		return departureVOList;
	}

	public void setDepartureVOList(List<DepartureVO> departureVOList) {
		this.departureVOList = departureVOList;
	}

	public DestinationVO getDestinationVO() {
		return destinationVO;
	}

	public void setDestinationVO(DestinationVO destinationVO) {
		this.destinationVO = destinationVO;
	}

	public DepartureVO getDepartureVO() {
		return departureVO;
	}

	public void setDepartureVO(DepartureVO departureVO) {
		this.departureVO = departureVO;
	}

	public ProductCategoryVO getProductCategoryVO() {
		return productCategoryVO;
	}

	public void setProductCategoryVO(ProductCategoryVO productCategoryVO) {
		this.productCategoryVO = productCategoryVO;
	}

	public CacheService getCacheService() {
		return cacheService;
	}

	public void setCacheService(CacheService cacheService) {
		this.cacheService = cacheService;
	}

	public TagService getTagService() {
		return tagService;
	}

	public void setTagService(TagService tagService) {
		this.tagService = tagService;
	}

	public List<TagVO> getTagVOList() {
		return tagVOList;
	}

	public void setTagVOList(List<TagVO> tagVOList) {
		this.tagVOList = tagVOList;
	}
}
